package com.bawei.wyg.glidimgmodel;

import android.content.Context;
import android.widget.ImageView;

import com.bawei.wyg.networkmodel.utils.BaseConstant;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;

public class GlideManager {
    private static GlideManager glideManager;

    public static GlideManager getGlideManager() {
        if(glideManager==null){
            glideManager=new GlideManager();
        }
        return glideManager;
    }


    public void setCirImg(ImageView img, Context context, String path){
        Glide.with(context).load(BaseConstant.FileUrl +path).transform(new CircleCrop()).into(img);
    }
    public void setCirJaoImg(ImageView img, Context context,String path){
        Glide.with(context).load(BaseConstant.FileUrl+path).transform(new CenterCrop(),new RoundedCorners(10)).into(img);
    }
    public void setNorImg(ImageView img, Context context,String path){
        Glide.with(context).load(BaseConstant.FileUrl+path).into(img);
    }
}
